package com.example.demo.model.entity;

import javax.persistence.*;
import java.math.BigDecimal;

@Entity
@Table(name = "t_product")
public class ProductModel {

    @Id
    @Column
    private String productId;

    @Column
    private String productName;

    @Column
    private Long createTime;

    @Column
    private String productDesc;

    @Column
    private BigDecimal price;

    @Column
    private Integer totalCount;

    @Column
    private String productImg;

    @Column
    private String productQrcode;

    @Column
    private String categoryId;

    @OneToOne
    @JoinColumn(name = "categoryId", insertable = false, updatable = false)
    CategoryModel category;

    public CategoryModel getCategory() {
        return category;
    }

    public void setCategory(CategoryModel category) {
        this.category = category;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getProductQrcode() {
        return productQrcode;
    }

    public void setProductQrcode(String productQrcode) {
        this.productQrcode = productQrcode;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public String getProductDesc() {
        return productDesc;
    }

    public void setProductDesc(String productDesc) {
        this.productDesc = productDesc;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public String getProductImg() {
        return productImg;
    }

    public void setProductImg(String productImg) {
        this.productImg = productImg;
    }
}
